<?php




namespace app\common\repositories\user;

use app\common\dao\user\UserTalentDao;
use app\common\repositories\BaseRepository;

/**
 * Class FeedbackRepository
 * @package app\common\repositories\user
 * @author xaboy
 * @day 2020/5/28
 * @mixin UserTalentDao
 */
class UserTalentRepository extends BaseRepository
{
    /**
     * FeedbackRepository constructor.
     * @param UserTalentDao $dao
     */
    public function __construct(UserTalentDao $dao)
    {
        $this->dao = $dao;
    }

    public function getList(array $where, $page, $limit)
    {
        $query = $this->dao->search($where);
        $count = $query->count();
        $list = $query->page($page, $limit)->select();
        return compact('count', 'list');
    }

    public function get( $id)
    {
        $data = $this->dao->getWhere([$this->dao->getPk() => $id]);
        return $data;
    }

}
